﻿<%@ Page Title="按地区查看配送关系" Language="C#" MasterPageFile="~/Enterprise/Master/AdminMaster.Master"
    AutoEventWireup="true" CodeBehind="ProductCompanySubArea.aspx.cs" Inherits="HZ.DrugTrade.Web.Enterprise.RelationQuery.ProductCompanySubArea" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript" language="javascript">
        function insertGoodsInfo(goodsInfo) {
            var varGoodsInfo = goodsInfo.split('|');
            document.all.ctl00_ContentPlaceHolder1_companyId.value = varGoodsInfo[0];
            document.all.ctl00_ContentPlaceHolder1_txtCompany.value = varGoodsInfo[1];
        }    
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="maincon">
        <div id="note">
            按地区维护配送关系</div>
        <div id="note2">
        </div>
        <table>
            <tr>
             <th align="right" width="20%">
                    <asp:Label ID="lblGoodsNameTag" runat="server" Text="产品名称："></asp:Label>
                </th>
                <td align="left">
                    <asp:Label ID="lblGoodsName" runat="server"></asp:Label>
                </td>
               
                 <th align="right">
                    <asp:Label ID="lblOutlookcTag" runat="server" Text="规格型号："></asp:Label>
                </th>
                <td align="left">
                    <asp:Label ID="lblOutlookc" runat="server"></asp:Label>
                </td>
               
            </tr>
         
            <tr>
                <th align="right">
                    <asp:Label ID="lblCompany_ZBTag" runat="server" Text="投标企业："></asp:Label>
                </th>
                <td align="left">
                    <asp:Label ID="lblCompany_ZB" runat="server"></asp:Label>
                </td>
                <th align="right">
                    <asp:Label ID="lblCompany_SCTag" runat="server" Text="生产厂家："></asp:Label>
                </th>
                <td align="left">
                    <asp:Label ID="lblCompany_SC" runat="server"></asp:Label>
                </td>
            </tr>
        </table>
    </div>
    <br />
    <div id="tabcontent2">
        <table class="querylist">
            <tr>
                <th>
                    地区：
                </th>
                <td>
                    <asp:DropDownList ID="ddlProvice" runat="server" Enabled="false">
                        <asp:ListItem Value="">所在省</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;
                    <asp:DropDownList ID="ddlCity" runat="server" Style="display: <%=Ishow%>">
                    </asp:DropDownList>
                </td>
               <%--<td>
                    <input id="hfdCompanyName" type="hidden" name="hfdCompanyName" runat="server" />
                    &nbsp;
                </td>
                <th align="right">
                    <asp:Label ID="lblCompany_PS" runat="server" Text="配送企业："></asp:Label>
                </th>
                <td>
                  <asp:TextBox ID="txtCompany" runat="server"></asp:TextBox><input id="companyId" type="hidden"
                        name="companyId" runat="server" />
                                     <input id="btnSelectCompany" type="button" style="width: 35px" value="选择" onclick="window.open('CompanySelect.aspx','SelectCompany','width=600,height=450,resizable=0,scrollbars=0, status=0, toolbar=0, menubar=0')"
                        class="btn" />&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnSelectCompanyByAreaId" Width="35" Text="选择" runat="server" OnClick="btnSelectCompanyByAreaId_Click"
                        CssClass="btn" />
                </td>--%>
                <th>配送企业名称：</th>
                <td>
                    <asp:TextBox runat="server" ID="txtCompanyName"></asp:TextBox>
                </td>
                <th>盟市审核状态：</th>
                <td>
                    <asp:DropDownList runat="server" ID="ddlauditstatus">
                                    <asp:ListItem Value="" Selected="True">全部</asp:ListItem>
                                    <asp:ListItem Value="0">未审核</asp:ListItem>
                                    <asp:ListItem Value="1">审核通过</asp:ListItem>
                                    <asp:ListItem Value="2">审核未通过</asp:ListItem>
                                </asp:DropDownList>
                </td>
                <td>
                     <asp:Button ID="btnSelect" Width="35" Text="查询" runat="server" CssClass="btn" OnClick="btnSelect_Click" />
                </td>
            </tr>
        </table>
    </div>
        <asp:GridView ID="gvwProduceCatalogOne" CssClass="mainlist" runat="server" AutoGenerateColumns="False"
         EmptyDataText="暂无符合条件的数据！" DataKeyNames="CompanyID">
        <Columns>
            <asp:TemplateField HeaderText="序号">
                <ItemTemplate>
                    <%#Container.DataItemIndex + 1 + AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex-1) %></ItemTemplate>
                <HeaderStyle Width="30px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="配送企业">
                <ItemTemplate>
                    <a href="javascript:void(0)" title="查看配送企业详细信息" onclick="window.open('../../CommonPage/CompanyInfo.aspx?companyid=<%# Eval("CompanyID") %>','selectCompany','width=550,height=350,resizable=0,scrollbars=0, status=0, toolbar=0, menubar=0')">
                        <%# Eval("companyname")%></a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    <input id="addTable_chkAll" name="chkAll" type="checkbox" onclick="SelectAllCheckboxes(this,'ctl00_ContentPlaceHolder1_gvwProduceCatalog','addTable_chkAll'); " />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="checkbox1" onclick="chkChecked(this,'ctl00_ContentPlaceHolder1_gvwProduceCatalog','addTable_chkAll');" runat="server"/>
                </ItemTemplate>
                <HeaderStyle Width="25px" />
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
     <div class="page">
        <webdiyer:AspNetPager ID="AspNetPager2" runat="server" 
             onpagechanged="AspNetPager2_PageChanged">
        </webdiyer:AspNetPager>
    </div>
    <asp:GridView ID="gvwProduceCatalog" CssClass="mainlist" runat="server" AutoGenerateColumns="False"
        OnRowDataBound="gvwProduceCatalog_RowDataBound" EmptyDataText="暂无符合条件的数据！" DataKeyNames="status,AreaID,CompanyID_PS,ProcureCatalogID,auditstatus">
        <Columns>
            <asp:TemplateField HeaderText="序号">
                <ItemTemplate>
                    <%#Container.DataItemIndex + 1 + AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex-1) %></ItemTemplate>
                <HeaderStyle Width="30px" />
            </asp:TemplateField>
            <asp:BoundField DataField="AreaName" HeaderText="地区" />
            <%--<asp:BoundField DataField="CompanyName_PS" HeaderText="配送企业" />--%>
            <asp:TemplateField HeaderText="配送企业">
                <ItemTemplate>
                    <a href="javascript:void(0)" title="查看配送企业详细信息" onclick="window.open('../../CommonPage/CompanyInfo.aspx?companyid=<%# Eval("CompanyID_PS") %>','selectCompany','width=550,height=350,resizable=0,scrollbars=0, status=0, toolbar=0, menubar=0')">
                        <%# Eval("companyname_ps")%></a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Status" HeaderText="确认状态" />
            <%--<asp:BoundField DataField="auditstatus" HeaderText="盟市审核状态" />--%>
            <asp:TemplateField HeaderText="盟市审核状态">
                <ItemTemplate>
                <%# Getauditstatus(Eval("auditstatus"))%>
                 </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField  DataField="Requestdelete" HeaderText="申请删除配送关系状态"/>
            <asp:TemplateField HeaderText="操作">
                <ItemTemplate>
                 <%--   <hz:HzLinkButton ID="lbtnDel" runat="server" CommandName="Del" OnClientClick="if(!this.disabled){return  confirm('确认要删除此行信息吗？');}else{return false;}"
                        Enabled='<%#(Eval("Status").ToString()=="已同意"|| Eval("Status").ToString()=="可配送")?false:trsue %>' OnClick="btn_Del">删除</hz:HzLinkButton>--%>
                        <%-- 成功删除“可配送”状态的产品，系统将自动记录一次不良记录。\u000d --%>
             <hz:HzLinkButton ID="lbtnDel" runat="server" CommandName="Del" OnClientClick="if(confirm('确认要删除此行信息吗？(删除之后将不能恢复)')){return  true;}else{return false;}"
              Enabled='<%#getCanDel(Eval("Status"),Eval("auditstatus"))%>' OperateType="删除"  OnClick="btn_Del">删除</hz:HzLinkButton>
              <hz:HzLinkButton ID="lbtnRequestDel" runat="server" CommandName="Request" OnClientClick="if(confirm(' 确认要申请删除此行信息吗？(删除之后将不能恢复)')){return  true;}else{return false;}"
                OperateType="删除"  Enabled="false"
                        onclick="lbtnRequestDel_Click">申请删除</hz:HzLinkButton>
                        <%-- Enabled='<%#getCanDel(Eval("Status")) == true?false:true%>' --%>
               <%-- Enabled='<%#((Eval("Status").ToString()=="可配送") && CanDel)||(Eval("Status").ToString()!="可配送"))?true:false %>' --%>
                 <%-- Enabled='<%#(Eval("Status").ToString()=="已同意"|| Eval("Status").ToString()=="可配送")?false:true %>' --%>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <div class="page">
        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_OnPageChanged">
        </webdiyer:AspNetPager>
    </div>
    <div class="listip">
        <ul>
       
           <!-- <li><span><span style="color:red">提示:</span> 1 删除“可配送状态”系统将记录一次不良记录。 </span></li>
             <li><span>   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   2 医疗机构和配送企业发生配送业务，配送关系不能删除。 </span></li>
      -->
        </ul>
    </div>

    <script type="text/javascript" language="javascript">
       new PCAS("ctl00$ContentPlaceHolder1$ddlProvice", "ctl00$ContentPlaceHolder1$ddlCity" <%=GetDefaultAreaString() %> );
    </script>

    <table class="querylist">
        <tr>
            <td align="center">
                    <hz:HzButton ID="HzButton1" runat="server" Width="100" CssClass="btn" Text="添加配送关系" OnClick="HzButton1_Click" 
                     OnClientClick="return checkSelectedItems('ctl00_ContentPlaceHolder1_gvwProduceCatalogOne','请至少选择一个配送企业！');" OperateType="添加配送关系" /> 
                    &nbsp;
                <asp:Button ID="Button1" Width="50" Text="完成" runat="server" OnClientClick="javascript:window.close();"
                    CssClass="btn" onclick="Button1_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
